package com.gzm.check.utils;

import lombok.Getter;
import lombok.Setter;

import java.util.Arrays;

@Getter
public enum ConvEnum {
    A("10", "A"),
    B("11", "B"),
    C("12", "C"),
    D("13", "D"),
    E("14", "E"),
    F("15", "F"),
    G("16", "G"),
    H("17", "H"),
    I("18", "I"),
    J("19", "J"),
    K("20", "K"),
    L("21", "L"),
    M("22", "M"),
    N("23", "N"),
    O("24", "O"),
    P("25", "P"),
    Q("26", "Q");

    private String code;
    private String name;

    ConvEnum(String code, String name) {
        this.code = code;
        this.name = name;
    }

    public static String getFieldName(String code) {
        for (ConvEnum c : ConvEnum.values()) {
            if (c.getCode().equals(code)) {
                return c.name();
            }
        }
        return code;
    }

}
